/**
 * Created by Administrator on 2016/6/21.
 */
import React from 'react';
import styles from '../../style.css';

class Avatar extends React.Component{
  render(){
    return (
      <div>
        <div className={styles.avatar}>
          <img src={this.props.src} alt={this.props.name} />
          <h3>{this.props.name}</h3>
        </div>
      </div>
    )
  }
}

const names_list = ['土豪', '邓佳鹏', '鲜肉', '郭庆伟', '何正婷', '胡旭阳', '陈虎', '周倩', '小阳'];

export default class Example2 extends React.Component{
  render(){
    var list = names_list.map(function(name, i){
      var src = './img/avatar' + (i + 1) + '.png';
      return (
        <li key={i}>
          <Avatar src={src} name={name} />
        </li>
      )
    });
    return (
      <ul className={styles.app}>
        {list}
      </ul>
    )
  }
}